<template>
	<view class="container">
		<u-toast ref="uToast" />
		<u-navbar :is-back="true" :title="main_title" back-icon-color='#333333' height="50" :border-bottom="false">
		</u-navbar>
		<view class="list">
			<view class="name">
				<text>名称:</text>
				<text>{{progress_obj.teacher_name}}</text>
			</view>
			<view class="num">
				<text>ID:</text>
				<text>{{progress_obj.check_user_role_id}}</text>
			</view>
			<view class="address">
				<text>地点</text>
				<text>{{progress_obj.teacher_user_info
?progress_obj.teacher_user_info.address:''
}}</text>
			</view>
			<view class="type">
				<text>类型</text>
				<text>{{progress_type}}</text>
			</view>
			<view class="galleryful">
				<text>容纳人数</text>
				<text></text>
			</view>
			<view class="remarks">
				<text>备注</text>
				<text>{{progress_obj.reason}}</text>
			</view>
			<view class="time">
				<text>使用时间</text>
				<text>{{progress_obj.create_time}}</text>
				<text>-</text>
				<text>{{progress_obj.update_time}}</text>
			</view>
			<view class="event">
				<text>事件</text>
				<input type="text" value="" v-model="content" placeholder="单行输入" />
			</view>
			<view class="accept">
				<text>受理结果</text>
				<text>{{main_title}}</text>
			</view>
			<view class=""
				style="width:710rpx; margin-left:20rpx; height:85rpx; display:flex;justify-content: flex-start;font-size:26rpx;color:#777777;">
				<text style=" margin-top:30rpx;">审核备注</text>
			</view>
			<view class=""
				style="width:710rpx; height:15rpx; margin-left:20rpx; background:#F2F2F2; border-top-left-radius:12rpx; border-top-right-radius:12rpx;">
			</view>
			<textarea value="" v-model="inputContent" placeholder="单行输入"
				style="width:710rpx; height:160rpx; margin-left:20rpx; background:#F2F2F2; text-indent:1em; border-bottom-left-radius:12rpx; border-bottom-right-radius:12rpx;" />
			<view class="" style="width:100rpx; height:15rpx;">

			</view>
		</view>
		<view class="confirm">
			<view class="verify" @click="$toLink('../approval_flow/approval_flow', {})">
				{{verify}}
			</view>
		</view>
	</view>
</template>

<script>
	import request from '../../request.js'
	export default {
		data() {
			return {
				content: '',
				inputContent: '',
				verify: '确认',
				progressId: '',
				main_title: '',
				progress_type: '',
				progress_obj: {},
			}
		},
		onLoad(option) {
			if (option.id) {
				this.progressId = option.id;
			}
			this.progressDetail();

		},
		methods: {
			progressDetail() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'teacher/progress/progressDetail',
					method: 'post',
					data: {
						progress_id: this.progressId ? this.progressId : 17,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.progress_obj = res.data.data;
							let str = res.data.data.progress_status;
							switch (str) {
								case 1:
									_this.main_title = '审核中';
									break;
								case 2:
									_this.main_title = '通过';
									break;
								case 3:
									_this.main_title = '撤回';
									break;
								case 4:
									_this.main_title = '不通过';
									break;
							}
							let progress_str = res.data.data.progress_type;
							switch (progress_str) {
								case 1:
									_this.progress_type = '请假申请';
									break;
								case 2:
									_this.progress_type = '退休申请';
									break;
								case 3:
									_this.progress_type = '护照申请';
									break;
							}
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		overflow: hidden;
		background: #F2F2F2;

		.list {
			width: 100%;
			margin-top: 20rpx;
			background: #fff;

			.name {
				width: 710rpx;
				margin-left: 20rpx;
				height: 62rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 30rpx;
					color: #333333;
					margin-top: 25rpx;

					&:nth-child(1) {
						width: 100rpx;
					}

					&:nth-child(2) {}
				}
			}

			.num {
				width: 710rpx;
				margin-left: 20rpx;
				border-bottom: 1px solid #F2F2F2;
				height: 91rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 30rpx;
					color: #333333;
					margin-top: 25rpx;

					&:nth-child(1) {
						margin-left: 30rpx;
						width: 75rpx;
					}

					&:nth-child(2) {}
				}
			}

			.address {
				width: 710rpx;
				margin-left: 20rpx;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.type {
				width: 710rpx;
				margin-left: 20rpx;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.galleryful {
				width: 710rpx;
				margin-left: 20rpx;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.remarks {
				width: 710rpx;
				margin-left: 20rpx;
				height: 100rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 192rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.time {
				width: 710rpx;
				margin-left: 20rpx;
				height: 97rpx;
				display: flex;
				justify-content: flex-start;
				border-bottom: 1px solid #F2F2F2;

				text {
					margin-top: 32rpx;
					font-size: 26rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
						width: 265rpx;
					}

					&:nth-child(3) {
						color: #333333;
						width: 16rpx;
					}

					&:nth-child(4) {
						color: #333333;
						width: 280rpx;
					}
				}
			}

			.event {
				width: 710rpx;
				margin-left: 20rpx;
				height: 65rpx;
				display: flex;
				justify-content: flex-start;

				text {

					&:nth-child(1) {
						margin-top: 30rpx;
						width: 150rpx;
						font-size: 26rpx;
						color: #777777;
					}
				}

				input {
					&:nth-child(2) {
						outline: none;
						border: none;
						font-size: 26rpx;
						color: #999999;
						margin-top: 30rpx;
						width: 400rpx;

					}
				}
			}

			.accept {
				width: 710rpx;
				margin-left: 20rpx;
				height: 70rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						font-size: 26rpx;
						color: #777777;
						width: 150rpx;
						margin-top: 30rpx;
					}

					&:nth-child(2) {
						font-size: 22rpx;
						height: 36rpx;
						line-height: 36rpx;
						text-align: center;
						width: 90rpx;
						border-radius: 5rpx;
						color: #fff;
						background: #2A7FFE;
						margin-top: 30rpx;
					}

				}

			}

		}

		.confirm {
			width: 100%;
			height: 300rpx;
			display: flex;
			justify-content: center;
			align-items: center;

			.verify {
				width: 200rpx;
				height: 60rpx;
				border-radius: 50rpx;
				text-align: center;
				line-height: 60rpx;
				background: linear-gradient(to right, #2C78FE, #32B0FF);
				color: #fff;
				font-size: 30rpx;
			}
		}
	}
</style>
